package com.kzj.controller;


import com.kzj.common.GlobalConstant;
import com.kzj.domain.dto.LoginDto;
import com.kzj.myJar.common.result.Result;
import com.kzj.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author kzj
 * @since 2024-11-27
 */
@RestController
@RequestMapping("/user")
public class UserController {
    @Autowired
    UserService userService;

    @PostMapping("/login")
    public Result login(@RequestBody LoginDto loginDto, @CookieValue(GlobalConstant.COOKIES_NAME) String cookie){
        String jwt=userService.login(loginDto,cookie);
        return Result.success(jwt);
    }



}

